Skip to content

Commit

Permalink
Merge branch 'master' into 4.5-7.10
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexRuiz7 committed Apr 12, 2023
2 parents 6104643 + 8a44757 commit 4ff37e9
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 24 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/new_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Example:
### Post-release
- [ ] Make draft releases final and public.
- [ ] Sync branches.
- [ ] Update [Compatibility Matrix](https://github.com/wazuh/wazuh-kibana-app/wiki/Compatibility).

### Supported versions

Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ All notable changes to the Wazuh app project will be documented in this file.
- Handling endpoint response was done when there is no data to show [#4918]https://github.com/wazuh/wazuh-kibana-app/pull/4918
- Fixed the 2 errors that appeared in console in Settings>Configuration section. [#5135](https://github.com/wazuh/wazuh-kibana-app/pull/5135)

## Wazuh v4.4.1 - Kibana 7.10.2, 7.16.x, 7.17.x - Revision 01

### Fixed

- Fixed the search in the agent inventory data tables [#5196](https://github.com/wazuh/wazuh-kibana-app/pull/5196)
- Fixed the `Anomaly and malware detection` link. [#5329](https://github.com/wazuh/wazuh-kibana-app/pull/5329)
- Fixed the problem that did not allow closing the time picker when the button was clicked again in `Agents` and `Management/Statistics`. [#5341](https://github.com/wazuh/wazuh-kibana-app/pull/5341)

## Wazuh v4.4.0 - Kibana 7.10.2, 7.16.x, 7.17.x - Revision 06

### Added
Expand Down
6 changes: 2 additions & 4 deletions common/api-info/security-actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@
"DELETE /agents/{agent_id}/group/{group_id}",
"PUT /agents/{agent_id}/group/{group_id}",
"DELETE /agents/group",
"PUT /agents/group",
"DELETE /groups"
"PUT /agents/group"
]
},
"group:modify_assignments": {
Expand All @@ -134,8 +133,7 @@
"DELETE /agents/{agent_id}/group/{group_id}",
"PUT /agents/{agent_id}/group/{group_id}",
"DELETE /agents/group",
"PUT /agents/group",
"DELETE /groups"
"PUT /agents/group"
]
},
"agent:restart": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import { AppState } from '../../../../react-services/app-state';


export function SyscollectorTable({ tableParams }) {
const [params, setParams] = useState({ limit: 10, offset: 0, });
const [params, setParams] = useState<{ limit: number, offset: number, select:string, q?: string}>({
limit: 10,
offset: 0,
select: tableParams.columns.map(({id}) => id).join(",")
});
const [pageIndex, setPageIndex] = useState(0);
const [searchBarValue, setSearchBarValue] = useState("");
const [pageSize, setPageSize] = useState(10);
Expand Down Expand Up @@ -67,7 +71,13 @@ export function SyscollectorTable({ tableParams }) {
setSearchBarValue(value);
timerDelaySearch && clearTimeout(timerDelaySearch);
const timeoutId = setTimeout(() => {
const newParams = { ...params, search: value };
const { q, ...rest} = params;
const newParams = {
...rest,
...(value ? {
q: tableParams.columns.map(({id}) => `${id}~${value}`).join(",")
}: {})
};
setParams(newParams);
setPageIndex(0);
}, 400)
Expand All @@ -85,7 +95,7 @@ export function SyscollectorTable({ tableParams }) {
await AppState.downloadCsv(
tableParams.path,
tableParams.exportFormatted,
!!params.search ? [{ name: 'search', value: params.search }] : []
!!params.q ? [{ name: 'q', value: params.q }] : []
)
}

Expand All @@ -101,11 +111,11 @@ export function SyscollectorTable({ tableParams }) {
<EuiFlexGroup>
<EuiFlexItem>
<EuiFieldSearch
placeholder={`Filter ${tableParams.title.toLowerCase()}...`}
placeholder='Search'
value={searchBarValue}
fullWidth={true}
onChange={onChange}
aria-label={`Filter ${tableParams.title.toLowerCase()}...`}
aria-label='Search'
/>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
6 changes: 3 additions & 3 deletions public/components/wz-date-picker/components/condensed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export function CondensedPicker({ ranges, onTimeChange }) {
return result;
}

const button = (<EuiButtonEmpty
onClick={() => setIsOpen(true)}
const button = (<EuiButtonEmpty
onClick={() => setIsOpen(!isOpen)}
iconType="arrowDown"
iconSide="right">
{!!customRange
Expand Down Expand Up @@ -78,4 +78,4 @@ export function CondensedPicker({ ranges, onTimeChange }) {
</EuiPopover>
)

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import { webDocumentationLink } from "../../../../../../../common/services/web_d

export default [
{
text: 'Anomaly and malware detection',
href: webDocumentationLink('user-manual/capabilities/anomalies-detection/index.html')
text: 'Malware detection',
href: webDocumentationLink('user-manual/capabilities/malware-detection/index.html')
},
{
text: 'Monitoring security policies',
Expand Down
56 changes: 46 additions & 10 deletions scripts/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,30 @@
import subprocess

# ==================== CONFIGURATION ==================== #
# Fill the variables below with the desired values
#
# Values to modify:
# - version
# - revision
# - stage
# - version - sent to the package.json
# - revision - sent to the package.json
# - stage - sent to the package.json
# - tag_suffix - used by the tag generation
# - supported_versions & kbn_versions ONLY IF NEEDED (e.g. new Kibana version)
# ======================================================= #

# Wazuh version: major.minor.patch
version = '4.4.0'
version = '4.4.1'
# App's revision number (previous rev + 1)
revision = '06'
revision = '01'
# One of 'pre-alpha', 'alpha', 'beta', 'release-candidate', 'stable'
stage = 'stable'

# Tag suffix. Usually set to stage + stage iteration.
tag_suffix = ''

# ================================================ #
# Constants and global variables #
# ================================================ #
LOG_FILE = 'output.log'
TAGS_FILE = 'tags.log'
# Global variable. Will be set later
branch = None
minor = ".".join(version.split('.')[:2])
Expand All @@ -41,16 +51,31 @@
},
'Wazuh Dashboard': {
'branch': f'{minor}-2.4-wzd',
'versions': ['2.4.1']
'versions': ['2.6.0']
}
}

# ================================================ #
# Functions #
# ================================================ #

def require_confirmation():
"""Ask for confirmation before running the script."""
print('WARNING! This script will commit and push the tags to the remote '
+ 'repository, deleting any unpushed changes.')
confirmation = input('Do you want to continue? [y/N] ')

if confirmation.lower() != 'y':
logging.info('Aborting...')
exit(0)


def get_git_revision_short_hash() -> str:
return subprocess.check_output(['git', 'rev-parse', '--short', branch]).decode('ascii').strip()


def update_package_json(v: str) -> tuple:
"""Update package.json with the new version and revision."""
logging.info(f'Updating package.json')
data, success = {}, True

Expand All @@ -74,18 +99,20 @@ def update_package_json(v: str) -> tuple:


def setup():
"""Sync the repo."""
logging.info(
f'Switching to branch "{branch}" and removing outdated tags...')
os.system(f'git checkout {branch}')
os.system('git fetch --prune --prune-tags')


def main(platform: str, versions: list):
"""Main function."""
for v in versions:
if stage == 'stable':
tag = f'v{version}-{v}'
else:
tag = f'v{version}-{v}-{stage}'
tag = f'v{version}-{v}-{tag_suffix}'
logging.info(f'Generating tag "{tag}"')
update_package_json(v)
os.system(f'git commit -am "Bump {tag}"')
Expand All @@ -95,20 +122,29 @@ def main(platform: str, versions: list):
os.system(f'git push origin {tag}')
# Undo latest commit
os.system(f'git reset --hard origin/{branch}')

# Save created tags to file
os.system(f'git tag | grep -P -i "^v{version}-.*-{stage}" > tags.txt')
os.system(f'git tag | grep -P -i "^v{version}-.*-{tag_suffix}" > {TAGS_FILE}')

# ================================================ #
# Main program #
# ================================================ #

if __name__ == '__main__':
logging.basicConfig(
filename='output.log',
filename=LOG_FILE,
level=logging.INFO,
format='%(asctime)s %(message)s'
)
logging.info(
f'Wazuh version is "{version}". App revision is "{revision}". Stage is "{stage}"')
require_confirmation()

for platform_name, platform_data in supported_versions.items():
branch, versions = platform_data['branch'], platform_data['versions']
setup()
main(platform_name, versions)


print(f'\nCOMPLETED. \nCheck {LOG_FILE} for more details.')
print(f'Tags are stored in {TAGS_FILE}')

0 comments on commit 4ff37e9

Please sign in to comment.